package hfu.pm.entities;

import java.util.Date;

import javax.persistence.Id;

import com.google.appengine.api.users.User;

public class Account {
	@Id
	Long id;
	
	String googleUserId;
	String email;
	User user;
	
	Date timestamp;

	public Account() {
		timestamp = new Date(System.currentTimeMillis());
	}

	public Long getId() {
		return id;
	}

	public String getGoogleUserId() {
		return googleUserId;
	}

//	private void setGoogleUserId(String googleUserId) {
//		this.googleUserId = googleUserId;
//	}

	public String getEmail() {
		return this.email;
	}
	
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
		this.email = user.getEmail();
		this.googleUserId = user.getUserId();
	}

	public Date getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(Date timestamp) {
		this.timestamp = timestamp;
	}
	
	public void setTimestamp() {
		this.timestamp = new Date(System.currentTimeMillis());
	}
		
}
